<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2019/3/15
 * Time: 11:26
 */

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class SysDistrict extends Model
{
    protected $table = 'sys_district';

    protected $primaryKey = 'id';

    public $timestamps = false;

    protected $fillable = [
        'name',             #名称
        'city_id',          #城市id
        'post_code',        #邮编
    ];

    public function city()
    {
        return $this->belongsTo(SysCity::class, 'city_id', 'id');
    }
}

